﻿// -------------------------------------------------------------------------
//    @FileName         :    NFSnsOnlineRole.h
//    @Author           :    gaoyi
//    @Date             :    2025-03-29
//    @Email			:    445267987@qq.com
//    @Module           :    NFSnsOnlineRole
//
// -------------------------------------------------------------------------

#pragma once

#include "NFComm/NFObjCommon/NFObject.h"
#include "NFLogicCommon/NFLogicShmTypeDefines.h"

class NFSnsOnlineRole : public NF_OBJECT_TEMPLATE_MACRO(NFSnsOnlineRole, EOT_SNS_ROLE_ONLINE, NFObject)
public:
    NFSnsOnlineRole();
    ~NFSnsOnlineRole() override;
    int CreateInit();
    int ResumeInit();
public:
    int Init(uint64_t roleId, int logicSvrId, uint64_t lastLoginTime , uint64_t lastLogoutTime);
    void SetLogicSvrId(int iLogicSvrId) { m_logicSvrId = iLogicSvrId; }
    int GetLogicSvrId() const { return m_logicSvrId; }
public:
    int SendMsgToLogicServer(uint32_t msgId, const google::protobuf::Message& data);
private:
    uint64_t m_roleId;
    int m_logicSvrId;
    uint64_t m_lastLoginTime;
    uint64_t m_lastLogoutTime;
};
